package com.flymobi.mshop.activity;

import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.flymobi.mshop.R;
import com.flymobi.mshop.util.ShopCarVo;

public class ShopCar extends Common {
	
	private TextView title;
	private Button shopping;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ShopCarVo shopCarVo = ShopCarVo.getInstance();
		if (shopCarVo.getCount()>0) {
			setContentView(R.layout.shopcar);
			
		}else{
			setContentView(R.layout.empty_shopping_cart);
			shopping = (Button) findViewById(R.id.settle_accounts);
			shopping.setOnClickListener(new OnClickListener() {
				
				@Override
				public void onClick(View arg0) {
//					forward(Home.class);
					Main main=(Main)ShopCar.this.getParent();//获得父类,
					main.getTabHost().setCurrentTab(0);
				}
			});
		}
		title = (TextView) findViewById(R.id.titleText);
		title.setText("购物车");
		
	}
	
	
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean onDown(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onLongPress(MotionEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		// TODO Auto-generated method stub
		return false;
	}
}
